package org.xnsg.app.model;

import com.eova.common.utils.web.RequestUtil;
import com.eova.model.EovaLog;
import com.eova.model.User;
import com.jfinal.core.Controller;

/**
 * @author zhaopan
 * @date :2017/4/16
 * @Description:
 */
public class EovaLogModel extends EovaLog{
    public static final EovaLogModel dao = new EovaLogModel();
    public void info(Controller con, int type, String info) {
        EovaLogModel el = new EovaLogModel();
        el.set("type", Integer.valueOf(type));
        User user = (User)con.getSessionAttr("user");
        el.set("user_id", user.get("id"));
        String ip = RequestUtil.getIp(con.getRequest());
        el.set("ip", ip);
        el.set("info", info);
        el.save();
    }
}
